package Views;

import Views.Base.BaseViewDeleteUser;
import Source.DeleteUser;
import UCM.UCDeleteUser;

/**
 * Creates the delete user interface
 * @author Josh
 */
public class ViewDeleteUser extends BaseViewDeleteUser {

    
    private final UCDeleteUser UCDeleteUser = new UCDeleteUser(this);
    private DeleteUser model;

    /**
     * Construction that initialises the delete user panel
     */
    public ViewDeleteUser() {
        deleteUserButton.addActionListener(new AdapterUCCToAL(UCDeleteUser));
    }


    /**
     * Gives model data to view.
     * @param model
     */
    public void loadTo(DeleteUser model) {
        this.model = model;
    }

    /**
     * Set the model with information entered by the user.
     */
    public void setModelData() {
        //model.setUsername()
        model.setPassword(new String(passwordField.getPassword()));
    }

    /**
     * Informs the user of success
     */
    public void updateDeleteSuccess() {
        ViewMain.getInstance();
    }
    

    /**
     * if the delete fails this function will inform the user why
     * @param text
     */
    public void updateFailure(String text) {
        
    }
}
